<extend name="Base/common"/>
<block name="body">
    <!-- 标签页导航 -->
    <div class="span9 page_message">
        <section id="contents">
            <include file="Addons/_nav"/>
            <div class="tab-content">
                <!-- 表单 -->
                <form id="form" action="{:U('reclaimScore')}" method="post" class="form-horizontal form-center">
                    <label class="item-label">
                        会员昵称
                    </label>
                    <input type="text" class="text input-medium" value="{$user['nickname']}" disabled
                           style="background: #f0f0f0;">

                    <label class="item-label">
                        <span class="need_flag">*</span>
                        回收积分
                    </label>
                    <input type="number" class="text input-medium" id="changeScore" name="changeScore" value="">

                    <label class="item-label">
                        <span class="need_flag">*</span>
                        回收详情
                    </label>
                    <input type="text" class="text input-medium" id="detail" name="detail" value="" placeholder="积分消费">


                    <div class="form-item cf">
                        <input type="hidden" name="id" value="{$user.id}">
                        <button class="btn submit-btn ajax-post" id="submit" type="submit"
                                target-form="form-horizontal">回 收
                        </button>
                    </div>
                </form>
                <include file="Addons/weixinPreview"/>
            </div>
        </section>
    </div>
</block>
<block name="script">
    <script type="text/javascript">
        $('#submit').click(function () {
            $('#submit').attr("disabled", "disabled"); // 禁用
            $('#form').submit();
        });

        $('#changeScore').change(function () {
            $('#submit').removeAttr('disabled'); // 启用
        });

        $('#detail').change(function () {
            $('#submit').removeAttr('disabled'); // 启用
        });
    </script>
</block>
